{extend name="layout/main" /}

{block name="header"}

{/block}

{block name="content"}
<style type="text/css">
    .link-th{
        color:blue;
    }
</style>
<section class="panel">
    <header class="panel-heading">
        <h4>商品列表</h4>
    </header>
    <div class="panel-body" style="padding-bottom: 50px">
        <form class="form-horizontal" action="{:url('admin/shopgoods/index')}">
            <div class="form-group">

                <div class="col-xs-3 no-pd-r">
                    <input type="text" id="keyword" value="{$Request.get.keyword}" name="keyword" class="form-control" placeholder="请输入商品标题">
                </div>
                <div class="col-xs-1 no-pd-r">
                    <select name="shoptype" id="shoptype" class="form-control">
                        <option  value="">商品类型</option>
                        <!--shoptype-->
                        {foreach $shoptype as $k=>$t}
                        <option  value="{$k}" {if $Request.get.shoptype == $k}selected{/if}>{$t}</option>
                        {/foreach}
                    </select>
                </div>
                <button type="submit" class="btn btn-color">搜索</button>
                <!-- <input name="export" value="0" type="hidden">
                <button type="button" class="btn btn-purple btnExport">导出</button> -->
                <a type="button" href="/admin/shopgoods/addgoods" class="btn btn-info">添加商品</a>
            </div>
        </form>
        <table class="table table-bordered table-striped no-margin">
            <thead>
            <tr>
                <th class="text-center">商品ID</th>
                <th class="text-center">图片</th>
                <th class="text-center">标题</th>
                <th class="text-center">商城类型</th>
                <th class="text-center">分类</th>
                <th class="text-center">库存</th>
                <th class="text-center">价格</th>
                <th class="text-center">状态</th>
                <th class="text-center">创建时间</th>
                <th class="text-center">操作</th>
            </tr>
            </thead>
            <tbody>
            {if !empty($list)}
            {foreach $list as $g}
            <tr>

                <td class="text-center">
                    {$g->id}
                </td>
                <td class="text-center">

                    <img src="{$g.img}" style="width: 100px;" alt="">
                </td>
                <td class="text-center">
                    {$g.title}
                </td>
                <td class="text-center">
                    {$g->shoptype[$g.shoptype]}
                </td>
                <td class="text-center">
                    {$g.category_title}
                </td>

                <td class="text-center">
                    {$g.total}
                </td>
                <td class="text-center">
                    {$g.price}
                </td>
                <td class="text-center">
                    <!--{$g->stata[$g.status]}-->
                    {if $g->status == '1'}
                    <a class="btn btn-xs btn-primary">已发布</a>
                    {else /}
                    <a class="btn btn-xs btn-warning">未发布</a>
                    {/if}
                </td>
                <td class="text-center">
                    {$g->createtime|date="Y-m-d H:i:s"}
                </td>

                <td style="vertical-align: middle" class="text-center">
                    <a href="{:url('shopgoods/editgoods',['id'=>$g->id])}" class="btn btn-xs btn-success">编辑</a>

                    <a data-url="{:url('shopgoods/delgoods',['id'=>$g->id])}" onclick="main.ajaxDelete(this)" data-msg="确定要删除商品吗？" class="btn btn-xs btn-danger">删除</a>

                </td>
            </tr>
            {/foreach}
            {else /}
            <tr class="text-center">
                <td colspan="9">暂无数据</td>
            </tr>
            {/if}
            </tbody>
        </table>
        <div class="page">
            {:htmlspecialchars_decode($list->render())}
        </div>
    </div>
</section>
{/block}
{block name="footer"}



{/block}
